package com.qingcheng.controller;


import com.alibaba.dubbo.config.annotation.Reference;
import com.qingcheng.service.goods.SkuService;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

@RestController
@RequestMapping("/sku")
@CrossOrigin("*")
public class SkuController {
    @Reference
    private SkuService skuService;

    @GetMapping("/price")
    public Integer price(String id){
        Integer price = skuService.findPrice(id);
        return  price;
    }

    @RequestMapping("/importAll")
    @ResponseBody
    public boolean importAll( ){
        boolean b = false;
        try {
            b = skuService.importAll();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return b;
    }

}
